package vcp.server.DAO.interfaces;

import java.util.List;
/**
 * 
 * @author VCP team
 *<p> generic DAO class</p>
 * @param <T>
 * @param <V>
 */
public interface IGenericDAO <T, V>
{
	/** find max Id number **/
	Integer findMaxID ();
	/** creates new T object **/
	T create ();
	/** find by entity and returns T object **/
	T findByEntity ( V entity );
	/** find by ID and returns T object **/
	T findByID ( int ID );
	/** fint by ID (string) and returns T object**/
	T findByID ( String ID );
	/** find all info and returns as T object **/
	List <T> findAll ( V info );
	/**
	 * saves changes in tables
	 * @param entity
	 * @return true if success
	 */
	boolean save ( T entity );
	/**
	 * refreshes tables after changing specific row 
	 * @param sqlQuery
	 * @return true is success
	 */
	boolean refresh ( String sqlQuery );
	/**
	 * deletes row from table by ID (int)
	 * @param ID
	 * @return true if success
	 */
	boolean deleteByID ( int ID );
	/**
	 * deletes row from table by ID (string)
	 * @param ID
	 * @return true if success
	 */
	boolean deleteByID ( String ID );
}
